package com.winterwar.base;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Set;

public class Slot extends BaseObject{
	/**
	 * 
	 */
	private static final long serialVersionUID = -6133207932393753343L;
	private Date startDate;
	private Date endDate;
	private Integer conID;
	private Integer slotID;
	private String slotName;
	@SuppressWarnings("rawtypes")
	private Set events;
	private Integer usedTables;
	private Integer totalTables;
	private Integer eventCount;
	
	private String startDateDate;
	private String startDateHour;
	private String startDateAMPM;
	private String endDateDate;
	private String endDateHour;
	private String endDateAMPM;
	
	private Boolean isLocked;

	private DateFormat _format = new SimpleDateFormat("mm/dd/yyyy hh a");

	@SuppressWarnings("rawtypes")
	public Set getEvents() {
		return events;
	}
	@SuppressWarnings("rawtypes")
	public void setEvents(Set events) {
		this.events = events;
	}
	
	public Date getStartDate() {
		return startDate;
	}
	public void setStartDate(Date startDate) {
		String toParse = _format.format(startDate);
		startDateDate = toParse.split(" ")[0];
		startDateHour = toParse.split(" ")[1];
		startDateAMPM = toParse.split(" ")[2];
		this.startDate = startDate;
	}
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		String toParse = _format.format(endDate);
		endDateDate = toParse.split(" ")[0];
		endDateHour = toParse.split(" ")[1];
		endDateAMPM = toParse.split(" ")[2];
		this.endDate = endDate;
	}
	public Integer getConID() {
		return conID;
	}
	public void setConID(Integer conID) {
		this.conID = conID;
	}
	public Integer getSlotID() {
		return slotID;
	}
	public void setSlotID(Integer slotID) {
		this.slotID = slotID;
	}
	public String getSlotName() {
		return slotName;
	}
	public void setSlotName(String slotName) {
		this.slotName = slotName;
	}
	
	public int hashCode(){
		if(slotID != null)
			return slotID.hashCode();
		else {
			Integer x = 0;
			return x.hashCode();
		}
	}
	public Integer getUsedTables() {
		return usedTables;
	}
	public void setUsedTables(Integer usedTables) {
		this.usedTables = usedTables;
	}
	public Integer getTotalTables() {
		return totalTables;
	}
	public void setTotalTables(Integer totalTables) {
		this.totalTables = totalTables;
	}
	public Integer getEventCount() {
		return eventCount;
	}
	public void setEventCount(Integer eventCount) {
		this.eventCount = eventCount;
	}
	public String getStartDateDate() {
		return startDateDate;
	}
	public void setStartDateDate(String startDateDate) {
		this.startDateDate = startDateDate;
	}
	public String getStartDateHour() {
		return startDateHour;
	}
	public void setStartDateHour(String startDateHour) {
		this.startDateHour = startDateHour;
	}
	public String getStartDateAMPM() {
		return startDateAMPM;
	}
	public void setStartDateAMPM(String startDateAMPM) {
		this.startDateAMPM = startDateAMPM;
	}
	public String getEndDateDate() {
		return endDateDate;
	}
	public void setEndDateDate(String endDateDate) {
		this.endDateDate = endDateDate;
	}
	public String getEndDateHour() {
		return endDateHour;
	}
	public void setEndDateHour(String endDateHour) {
		this.endDateHour = endDateHour;
	}
	public String getEndDateAMPM() {
		return endDateAMPM;
	}
	public void setEndDateAMPM(String endDateAMPM) {
		this.endDateAMPM = endDateAMPM;
	}
	public Boolean getIsLocked() {
		return isLocked;
	}
	public void setIsLocked(Boolean isLocked) {
		this.isLocked = isLocked;
	}

}
